package scuff.msg.binary

import scuff.msg._

import java.nio.ByteBuffer

trait DispatchingFixedLengthMessageReader[CB]
    extends DispatchingMessageReader[ByteBuffer, CB, scuff.DoubleDispatch[CB]] {

  def callback: CB

  def messageLength(buf: ByteBuffer): Int
  
  override def read(buf: ByteBuffer) {
    super.read(buf)
    buf.position(buf.position + messageLength(buf))
  }
}